/**
 * 
 */
package com.viettel.core.entities.cms;

import java.io.Serializable;



import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.ForeignKey;
import org.hibernate.annotations.Index;
import org.hibernate.annotations.Parameter;
import org.hibernate.annotations.Type;

import com.viettel.core.enumtype.ExpertGroupStatus;


/**
 *  TABLE EXPERT_GROUP
 *  @author: HUYNHDC
 *  @version: 1.0
 *  @since: 24-06-2014
 */
@Entity
@Table(name = "EXPERT_GROUP")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@SequenceGenerator(name = "SEQ_STORE", sequenceName = "EXPERT_GROUP_SEQ", allocationSize = 1)
public class ExpertGroup implements Serializable {

    /**
	 * 
	 */
	private static final long serialVersionUID = -5598992362634785467L;

	/** The id. */
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_STORE")
    @Column(name = "ID")
    private Integer id;
    
   
    @ManyToOne(targetEntity = CmsUser.class)
    @JoinColumn(name = "CMS_USERS_ID", referencedColumnName = "id")
    @ForeignKey(name = "EXPERT_GROUP_CMS_USER_FK")
    private CmsUser cmsUser;

    @ManyToOne(targetEntity = GroupCategory.class)
    @JoinColumn(name = "GROUP_CATEGORY_ID", referencedColumnName = "id")
    @ForeignKey(name = "EXPERT_GROUP_GROUP_CATEGORY_FK")
    private GroupCategory groupCategory;

	@Basic
	@Column(name = "STATUS", columnDefinition = "NUMBER(1,0)", nullable = false)
	@Type(type = "com.viettel.core.enumtype.GenericEnumUserType", parameters = {
			@Parameter(name = "enumClass", value = "com.viettel.core.enumtype.ExpertGroupStatus"),
			@Parameter(name = "identifierMethod", value = "getValue"),
			@Parameter(name = "valueOfMethod", value = "parseValue") })
	@Index(name="EXPERT_GROUP_STATUSX")
	private ExpertGroupStatus status;
    
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	
	
	public CmsUser getCmsUser() {
		return cmsUser;
	}

	public void setCmsUser(CmsUser cmsUser) {
		this.cmsUser = cmsUser;
	}

	public GroupCategory getGroupCategory() {
		return groupCategory;
	}

	public void setGroupCategory(GroupCategory groupCategory) {
		this.groupCategory = groupCategory;
	}

	public ExpertGroupStatus getStatus() {
		return status;
	}

	public void setStatus(ExpertGroupStatus status) {
		this.status = status;
	}
    
	
    
	
}
